﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Miris.HumanMilkAnalyser.WPF.CustomizedUserControl;
using Miris.HumanMilkAnalyser.WPF.ViewModel;

namespace Miris.HumanMilkAnalyser.WPF
{
    /// <summary>
    /// Interaction logic for AnalysisReportWindow.xaml
    /// </summary>
    public partial class AnalysisReportWindow : Window
    {
        public AnalysisReportWindow()
        {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            // Check if need to add another FixedPage to display Breastfeeding Significance.
            if (((AnalysisReportViewModel)DataContext).IncludeBreastfeedingSignificance)
            {
                var fixedPage = new FixedPage()
                {
                    Width = 793.76,
                    Height = 1122.56,
                    DataContext = DataContext
                };

                fixedPage.Children.Add(new BreastfeedingSignificanceReportContentUserControl());

                CurrentFixedDocument.Pages.Add(new PageContent()
                    {
                        Child = fixedPage
                    });
            }
        }
    }
}
